package com.ywh.auth.configuration;

/**
 * @Auther: yanke
 * @Date: 2018/8/31 0031 14:08
 * @Description:
 */

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;


/**
 * WebMvc,自定义配置
 */
//@EnableWebMvc   //纯注解启动Spring MVC配置
////@Configuration
////@Slf4j
public class WebMvcConfiguration implements WebMvcConfigurer {

    /**
     * 跨域配置
     *
     * @param registry
     */
    @Override
    public void addCorsMappings(CorsRegistry registry) {
        registry.addMapping("/**")
                .allowedOrigins("*")
                .allowedHeaders("*")
                .allowedMethods("*");
//        WebMvcConfigurer.super.addCorsMappings(registry);
    }
}

